<template>
  <div>
    <div class="topnav">
      <div class="icon">
        <van-icon color="#fff" size="1.5rem" name="arrow-left" />
      </div>
      <van-search
        class="search"
        v-model="value"
        show-action
        background="#1cb676"
        placeholder="请输入小区或地址"
        @search="onSearch"
      >
        <template #label>
          <div @click="$router.push('/listcity')">
            <span ref="city">{{ city }}</span>
            <van-icon name="arrow-down" />
          </div>
        </template>
        <template #action>
          <div class="action" @click="onSearch">
            <van-icon color="#fff" size="1.5rem" name="map-marked" />
          </div>
        </template>
      </van-search>
    </div>
    
    <div class="main"></div>
  </div>
</template>

<script>
import { housesCond } from '@/api/article'
import { getCityname, getCitycode } from '@/utils/storage'
export default {
  async created() {
    this.city = getCityname()
    const area = await housesCond(getCitycode())
    console.log(area)
  },
  data() {
    return {
      city: '',
      cityValue: '',
      value: '',
      
    }
  },
  methods: {
    onSearch() {},
  }
}
</script>

<style lang="less" scoped>
.topnav {
  display: flex;
  width: 100%;
  height: 3.125rem;
  background-color: #1cb676;
  .search {
    margin-top: 0.425rem;
    width: 90%;
    height: 2.125rem;
    border-radius: 0.325rem;
    overflow: hidden;
  }
  .icon {
    width: 2rem;
    line-height: 3.5rem;
    text-align: center;
  }
  .action {
    padding-top: 5px;
  }
}
.unselected {
  display: flex;
  height: 40px;
  border-bottom: 1px solid #e4e6f0;
  overflow: hidden;
  li {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 25%;
    height: 40px;
  }
  .active {
    color: #21b97a;
  }
}
</style>
